home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / QuickTime / QuickTime 3 Interfaces & Libs / QTDevMac / PInterfaces / QD3DRenderer.p < prev    next >
Encoding:
Text File  |  1998-08-21  |  42.5 KB  |  1,248 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DRenderer.p
  3.  
  4.      Contains:    Q3Renderer types and routines                                          
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DRenderer;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DRENDERER__}
  28. {$SETC __QD3DRENDERER__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DRendererIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QD3DSET__}
  38. {$I QD3DSet.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QD3DVIEW__}
  41. {$I QD3DView.p}
  42. {$ENDC}
  43.  
  44. {$IFC TARGET_OS_MAC }
  45. {$IFC UNDEFINED __EVENTS__}
  46. {$I Events.p}
  47. {$ENDC}
  48. {$ENDC}  {TARGET_OS_MAC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN POWER}
  53. {$LibExport+}
  54.  
  55. {*****************************************************************************
  56.  **                                                                             **
  57.  **                            User Interface Things                             **
  58.  **                                                                             **
  59.  ****************************************************************************}
  60. {$IFC TARGET_OS_MAC }
  61. {
  62.  *  A callback to an application's event handling code. This is needed to    
  63.  *  support movable modal dialogs. The dialog's event filter calls this      
  64.  *  callback with events it does not handle.                                 
  65.  *  If an application handles the event it should return kQ3True.            
  66.  *  If the application does not handle the event it must return kQ3False and 
  67.  *  the dialog's event filter will pass the event to the system unhandled.   
  68.  }
  69.  
  70. TYPE
  71. {$IFC TYPED_FUNCTION_POINTERS}
  72.     TQ3MacOSDialogEventHandler = FUNCTION((CONST)VAR event: EventRecord): TQ3Boolean; C;
  73. {$ELSEC}
  74.     TQ3MacOSDialogEventHandler = ProcPtr;
  75. {$ENDC}
  76.  
  77.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  78.     TQ3DialogAnchor = RECORD
  79.         clientEventHandler:        TQ3MacOSDialogEventHandler;
  80.     END;
  81.  
  82. {$ENDC}  {TARGET_OS_MAC}
  83.  
  84. {$IFC TARGET_OS_WIN32 }
  85.  
  86. TYPE
  87.     TQ3DialogAnchor = RECORD
  88.         ownerWindow:            HWND;
  89.     END;
  90.  
  91. {$ENDC}  {TARGET_OS_WIN32}
  92.  
  93. {$IFC TARGET_OS_UNIX }
  94.  
  95. TYPE
  96.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  97.     TQ3DialogAnchor = RECORD
  98.         notUsed:                Ptr;                                    {  place holder  }
  99.     END;
  100.  
  101. {$ENDC}  {TARGET_OS_UNIX}
  102.  
  103. {*****************************************************************************
  104.  **                                                                             **
  105.  **                            Renderer Functions                                 **
  106.  **                                                                             **
  107.  ****************************************************************************}
  108. FUNCTION Q3Renderer_NewFromType(rendererObjectType: TQ3ObjectType): TQ3RendererObject; C;
  109. FUNCTION Q3Renderer_GetType(renderer: TQ3RendererObject): TQ3ObjectType; C;
  110.  
  111. { Q3Renderer_Flush has been replaced by Q3View_Flush }
  112. { Q3Renderer_Sync has been replaced by Q3View_Sync }
  113.  
  114. {
  115.  *    Q3Renderer_IsInteractive
  116.  *        Determine if this renderer is intended to be used interactively.
  117.  }
  118. FUNCTION Q3Renderer_IsInteractive(renderer: TQ3RendererObject): TQ3Boolean; C;
  119.  
  120. {
  121.  *    Q3Renderer_HasModalConfigure
  122.  *        Determine if this renderer has a modal settings dialog.
  123.  *
  124.  *    Q3Renderer_ModalConfigure
  125.  *        Have the renderer pop up a modal dialog box to configure its settings.
  126.  *    dialogAnchor - is platform specific data passed by the client to support
  127.  *      movable modal dialogs. 
  128.  *    MacOS: this is a callback to the calling application's event handler.
  129.  *      The renderer calls this function with events not handled by the 
  130.  *      settings dialog. This is necessary in order to support movable modal 
  131.  *      dialogs. An application's event handler must return kQ3True if it 
  132.  *      handles the event passed to the callback or kQ3False if not. 
  133.  *      An application which doesn't want to support a movable modal configure
  134.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  135.  *    Win32: this is the HWND of the owning window (typically an application's
  136.  *      main window).
  137.  *  canceled - returns a boolean inditacating that the user canceled the 
  138.  *    dialog.
  139.  *      
  140.  }
  141. FUNCTION Q3Renderer_HasModalConfigure(renderer: TQ3RendererObject): TQ3Boolean; C;
  142. FUNCTION Q3Renderer_ModalConfigure(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean): TQ3Status; C;
  143. {
  144.  *    Q3RendererClass_GetNickNameString
  145.  *        Allows an application to get a renderers name string, the 
  146.  *        renderer is responsible for storing this in a localizable format
  147.  *        for example as a resource.  This string can then be used to provide
  148.  *        a selection mechanism for an application (for example in a menu).
  149.  *
  150.  *        If this call returns nil in the supplied string, then the App may 
  151.  *         choose to use the class name for the renderer.  You should always 
  152.  *        try to get the name string before using the class name, since the
  153.  *        class name is not localizable.
  154.  }
  155. FUNCTION Q3RendererClass_GetNickNameString(rendererClassType: TQ3ObjectType; VAR rendererClassString: TQ3ObjectClassNameString): TQ3Status; C;
  156.  
  157. {
  158.  *    Q3Renderer_GetConfigurationData
  159.  *        Allows an application to collect private renderer configuration data
  160.  *      which it will then save. For example in a preference file or in a 
  161.  *        style template. An application should tag this data with the 
  162.  *        Renderer's object  name.
  163.  *    
  164.  *        if dataBuffer is NULL actualDataSize returns the required size in 
  165.  *        bytes of a data buffer large enough to store private data. 
  166.  *
  167.  *      bufferSize is the actual size of the memory block pointed to by 
  168.  *        dataBuffer
  169.  *
  170.  *        actualDataSize - on return the actual number of bytes written to the 
  171.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  172.  * 
  173.  }
  174. FUNCTION Q3Renderer_GetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  175. FUNCTION Q3Renderer_SetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32): TQ3Status; C;
  176.  
  177.  
  178. {*****************************************************************************
  179.  **                                                                             **
  180.  **                        Interactive Renderer Specific Functions                 **
  181.  **                                                                             **
  182.  ****************************************************************************}
  183. { CSG IDs attribute }
  184. { Object IDs, to be applied as attributes on geometries }
  185.  
  186. CONST
  187.     kQ3AttributeTypeConstructiveSolidGeometryID = 'csgi';
  188.  
  189.     kQ3SolidGeometryObjNone        = -1;
  190.     kQ3SolidGeometryObjA        = 0;
  191.     kQ3SolidGeometryObjB        = 1;
  192.     kQ3SolidGeometryObjC        = 2;
  193.     kQ3SolidGeometryObjD        = 3;
  194.     kQ3SolidGeometryObjE        = 4;
  195.  
  196. { Possible CSG equations }
  197.  
  198. TYPE
  199.     TQ3CSGEquation                 = LONGINT;
  200. CONST
  201.     kQ3CSGEquationAandB            = {TQ3CSGEquation}$88888888;
  202.     kQ3CSGEquationAandnotB        = {TQ3CSGEquation}$22222222;
  203.     kQ3CSGEquationAanBonCad        = {TQ3CSGEquation}$2F222F22;
  204.     kQ3CSGEquationnotAandB        = {TQ3CSGEquation}$44444444;
  205.     kQ3CSGEquationnAaBorCanB    = {TQ3CSGEquation}$74747474;
  206.  
  207. FUNCTION Q3InteractiveRenderer_SetCSGEquation(renderer: TQ3RendererObject; equation: TQ3CSGEquation): TQ3Status; C;
  208. FUNCTION Q3InteractiveRenderer_GetCSGEquation(renderer: TQ3RendererObject; VAR equation: TQ3CSGEquation): TQ3Status; C;
  209. FUNCTION Q3InteractiveRenderer_SetPreferences(renderer: TQ3RendererObject; vendorID: LONGINT; engineID: LONGINT): TQ3Status; C;
  210. FUNCTION Q3InteractiveRenderer_GetPreferences(renderer: TQ3RendererObject; VAR vendorID: LONGINT; VAR engineID: LONGINT): TQ3Status; C;
  211. FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass(renderer: TQ3RendererObject; bypass: TQ3Boolean): TQ3Status; C;
  212. FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass(renderer: TQ3RendererObject; VAR bypass: TQ3Boolean): TQ3Status; C;
  213. FUNCTION Q3InteractiveRenderer_SetRAVEContextHints(renderer: TQ3RendererObject; RAVEContextHints: UInt32): TQ3Status; C;
  214. FUNCTION Q3InteractiveRenderer_GetRAVEContextHints(renderer: TQ3RendererObject; VAR RAVEContextHints: UInt32): TQ3Status; C;
  215. FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter(renderer: TQ3RendererObject; RAVEtextureFilterValue: UInt32): TQ3Status; C;
  216. FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter(renderer: TQ3RendererObject; VAR RAVEtextureFilterValue: UInt32): TQ3Status; C;
  217.  
  218. {*****************************************************************************
  219.  **                                                                             **
  220.  **                            Renderer View Tools                                 **
  221.  **                                                                             **
  222.  **                    You may only call these methods from a plug-in             **
  223.  **                                                                             **
  224.  ****************************************************************************}
  225. {
  226.  *    Call by a renderer to call the user "idle" method, with progress 
  227.  *    information.
  228.  *    
  229.  *    Pass in (view, 0, n) on first call
  230.  *    Pass in (view, 1..n-1, n) during rendering
  231.  *    Pass in (view, n, n) upon completion
  232.  *    
  233.  *    Note: The user must have supplied an idleProgress method with 
  234.  *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  235.  *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  236.  *    is called instead. (current and final are ignored, essentially.)
  237.  *
  238.  *    Returns kQ3Failure if rendering is cancelled.
  239.  }
  240. FUNCTION Q3XView_IdleProgress(view: TQ3ViewObject; current: UInt32; completed: UInt32): TQ3Status; C;
  241. {
  242.  *    Called by an asynchronous renderer when it completes a frame.
  243.  }
  244. FUNCTION Q3XView_EndFrame(view: TQ3ViewObject): TQ3Status; C;
  245.  
  246. {*****************************************************************************
  247.  **                                                                             **
  248.  **                            Renderer AttributeSet Tools                         **
  249.  **                                                                             **
  250.  **                    You may only call these methods from a plug-in             **
  251.  **                                                                             **
  252.  ****************************************************************************}
  253. {
  254.  *    Faster access to geometry attribute sets.
  255.  *    
  256.  *    Returns pointer to INTERNAL data structure for elements and attributes
  257.  *    in an attributeSet, or NULL if no attribute exists.
  258.  *    
  259.  *    For attributes of type kQ3AttributeType..., the internal data structure
  260.  *    is identical to the data structure used in Q3AttributeSet_Add.
  261.  }
  262. FUNCTION Q3XAttributeSet_GetPointer(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): Ptr; C;
  263.  
  264.  
  265. CONST
  266.     kQ3XAttributeMaskNone        = 0;
  267.     kQ3XAttributeMaskSurfaceUV    = $01;
  268.     kQ3XAttributeMaskShadingUV    = $02;
  269.     kQ3XAttributeMaskNormal        = $04;
  270.     kQ3XAttributeMaskAmbientCoefficient = $08;
  271.     kQ3XAttributeMaskDiffuseColor = $10;
  272.     kQ3XAttributeMaskSpecularColor = $20;
  273.     kQ3XAttributeMaskSpecularControl = $40;
  274.     kQ3XAttributeMaskTransparencyColor = $80;
  275.     kQ3XAttributeMaskSurfaceTangent = $0100;
  276.     kQ3XAttributeMaskHighlightState = $0200;
  277.     kQ3XAttributeMaskSurfaceShader = $0400;
  278.     kQ3XAttributeMaskCustomAttribute = $80000000;
  279.     kQ3XAttributeMaskAll        = $800007FF;
  280.     kQ3XAttributeMaskInherited    = $03FF;
  281.     kQ3XAttributeMaskInterpolated = $01FF;
  282.  
  283.  
  284. TYPE
  285.     TQ3XAttributeMask                    = UInt32;
  286. FUNCTION Q3XAttributeSet_GetMask(attributeSet: TQ3AttributeSet): TQ3XAttributeMask; C;
  287.  
  288. {*****************************************************************************
  289.  **                                                                             **
  290.  **                            Renderer Draw Context Tools                         **
  291.  **                                                                             **
  292.  ****************************************************************************}
  293.  
  294. TYPE
  295.     TQ3XDrawRegion = ^LONGINT;
  296. FUNCTION Q3XDrawContext_GetDrawRegion(drawContext: TQ3DrawContextObject; VAR drawRegion: TQ3XDrawRegion): TQ3Status; C;
  297.  
  298. TYPE
  299.     TQ3XDrawContextValidationMasks  = LONGINT;
  300. CONST
  301.     kQ3XDrawContextValidationClearFlags = {TQ3XDrawContextValidationMasks}$00000000;
  302.     kQ3XDrawContextValidationDoubleBuffer = {TQ3XDrawContextValidationMasks}$01;
  303.     kQ3XDrawContextValidationShader = {TQ3XDrawContextValidationMasks}$02;
  304.     kQ3XDrawContextValidationClearFunction = {TQ3XDrawContextValidationMasks}$04;
  305.     kQ3XDrawContextValidationActiveBuffer = {TQ3XDrawContextValidationMasks}$08;
  306.     kQ3XDrawContextValidationInternalOffScreen = {TQ3XDrawContextValidationMasks}$10;
  307.     kQ3XDrawContextValidationPane = {TQ3XDrawContextValidationMasks}$20;
  308.     kQ3XDrawContextValidationMask = {TQ3XDrawContextValidationMasks}$40;
  309.     kQ3XDrawContextValidationDevice = {TQ3XDrawContextValidationMasks}$80;
  310.     kQ3XDrawContextValidationWindow = {TQ3XDrawContextValidationMasks}$0100;
  311.     kQ3XDrawContextValidationWindowSize = {TQ3XDrawContextValidationMasks}$0200;
  312.     kQ3XDrawContextValidationWindowClip = {TQ3XDrawContextValidationMasks}$0400;
  313.     kQ3XDrawContextValidationWindowPosition = {TQ3XDrawContextValidationMasks}$0800;
  314.     kQ3XDrawContextValidationPlatformAttributes = {TQ3XDrawContextValidationMasks}$1000;
  315.     kQ3XDrawContextValidationForegroundShader = {TQ3XDrawContextValidationMasks}$2000;
  316.     kQ3XDrawContextValidationBackgroundShader = {TQ3XDrawContextValidationMasks}$4000;
  317.     kQ3XDrawContextValidationColorPalette = {TQ3XDrawContextValidationMasks}$8000;
  318.     kQ3XDrawContextValidationAll = {TQ3XDrawContextValidationMasks}$FFFFFFFF;
  319.  
  320.  
  321. TYPE
  322.     TQ3XDrawContextValidation            = UInt32;
  323. FUNCTION Q3XDrawContext_ClearValidationFlags(drawContext: TQ3DrawContextObject): TQ3Status; C;
  324. FUNCTION Q3XDrawContext_GetValidationFlags(drawContext: TQ3DrawContextObject; VAR validationFlags: TQ3XDrawContextValidation): TQ3Status; C;
  325.  
  326. {*****************************************************************************
  327.  **                                                                             **
  328.  **                            Renderer Draw Region Tools                         **
  329.  **                                                                             **
  330.  ****************************************************************************}
  331.  
  332. TYPE
  333.     TQ3XDevicePixelType         = LONGINT;
  334. CONST
  335.                                                                 {  These do not indicate byte ordering    }
  336.     kQ3XDevicePixelTypeInvalid    = {TQ3XDevicePixelType}0;        {  Unknown, un-initialized type      }
  337.     kQ3XDevicePixelTypeRGB32    = {TQ3XDevicePixelType}1;        {  Alpha:8 (ignored), R:8, G:8, B:8  }
  338.     kQ3XDevicePixelTypeARGB32    = {TQ3XDevicePixelType}2;        {  Alpha:8, R:8, G:8, B:8               }
  339.     kQ3XDevicePixelTypeRGB24    = {TQ3XDevicePixelType}3;        {  24 bits/pixel, R:8, G:8, B:8      }
  340.     kQ3XDevicePixelTypeRGB16    = {TQ3XDevicePixelType}4;        {  Alpha:1 (ignored), R:5, G:5, B:5  }
  341.     kQ3XDevicePixelTypeARGB16    = {TQ3XDevicePixelType}5;        {  Alpha:1, R:5, G:5, B:5               }
  342.     kQ3XDevicePixelTypeRGB16_565 = {TQ3XDevicePixelType}6;        {  16 bits/pixel, R:5, G:6, B:5      }
  343.     kQ3XDevicePixelTypeIndexed8    = {TQ3XDevicePixelType}7;        {  8-bit color table index              }
  344.     kQ3XDevicePixelTypeIndexed4    = {TQ3XDevicePixelType}8;        {  4-bit color table index              }
  345.     kQ3XDevicePixelTypeIndexed2    = {TQ3XDevicePixelType}9;        {  2-bit color table index              }
  346.     kQ3XDevicePixelTypeIndexed1    = {TQ3XDevicePixelType}10;        {  1-bit color table index              }
  347.  
  348.  
  349. TYPE
  350.     TQ3XClipMaskState             = LONGINT;
  351. CONST
  352.     kQ3XClipMaskFullyExposed    = {TQ3XClipMaskState}0;
  353.     kQ3XClipMaskPartiallyExposed = {TQ3XClipMaskState}1;
  354.     kQ3XClipMaskNotExposed        = {TQ3XClipMaskState}2;
  355.  
  356.  
  357. TYPE
  358.     TQ3XColorDescriptorPtr = ^TQ3XColorDescriptor;
  359.     TQ3XColorDescriptor = RECORD
  360.         redShift:                UInt32;
  361.         redMask:                UInt32;
  362.         greenShift:                UInt32;
  363.         greenMask:                UInt32;
  364.         blueShift:                UInt32;
  365.         blueMask:                UInt32;
  366.         alphaShift:                UInt32;
  367.         alphaMask:                UInt32;
  368.     END;
  369.  
  370.     TQ3XDrawRegionDescriptorPtr = ^TQ3XDrawRegionDescriptor;
  371.     TQ3XDrawRegionDescriptor = RECORD
  372.         width:                    UInt32;
  373.         height:                    UInt32;
  374.         rowBytes:                UInt32;
  375.         pixelSize:                UInt32;
  376.         pixelType:                TQ3XDevicePixelType;
  377.         colorDescriptor:        TQ3XColorDescriptor;
  378.         bitOrder:                TQ3Endian;
  379.         byteOrder:                TQ3Endian;
  380.         clipMask:                TQ3BitmapPtr;
  381.     END;
  382.  
  383.     TQ3XDrawRegionServicesMasks  = LONGINT;
  384. CONST
  385.     kQ3XDrawRegionServicesNoneFlag = {TQ3XDrawRegionServicesMasks}0;
  386.     kQ3XDrawRegionServicesClearFlag = {TQ3XDrawRegionServicesMasks}$01;
  387.     kQ3XDrawRegionServicesDontLockDDSurfaceFlag = {TQ3XDrawRegionServicesMasks}$02;
  388.  
  389.  
  390. TYPE
  391.     TQ3XDrawRegionServices                = UInt32;
  392. {$IFC TYPED_FUNCTION_POINTERS}
  393.     TQ3XDrawRegionRendererPrivateDeleteMethod = PROCEDURE(rendererPrivate: UNIV Ptr); C;
  394. {$ELSEC}
  395.     TQ3XDrawRegionRendererPrivateDeleteMethod = ProcPtr;
  396. {$ENDC}
  397.  
  398. FUNCTION Q3XDrawRegion_GetDeviceScaleX(drawRegion: TQ3XDrawRegion; VAR deviceScaleX: Single): TQ3Status; C;
  399. FUNCTION Q3XDrawRegion_GetDeviceScaleY(drawRegion: TQ3XDrawRegion; VAR deviceScaleY: Single): TQ3Status; C;
  400.  
  401. FUNCTION Q3XDrawRegion_GetDeviceOffsetX(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  402. FUNCTION Q3XDrawRegion_GetDeviceOffsetY(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  403.  
  404. FUNCTION Q3XDrawRegion_GetWindowScaleX(drawRegion: TQ3XDrawRegion; VAR windowScaleX: Single): TQ3Status; C;
  405. FUNCTION Q3XDrawRegion_GetWindowScaleY(drawRegion: TQ3XDrawRegion; VAR windowScaleY: Single): TQ3Status; C;
  406.  
  407. FUNCTION Q3XDrawRegion_GetWindowOffsetX(drawRegion: TQ3XDrawRegion; VAR windowOffsetX: Single): TQ3Status; C;
  408. FUNCTION Q3XDrawRegion_GetWindowOffsetY(drawRegion: TQ3XDrawRegion; VAR windowOffsetY: Single): TQ3Status; C;
  409. FUNCTION Q3XDrawRegion_IsActive(drawRegion: TQ3XDrawRegion; VAR isActive: TQ3Boolean): TQ3Status; C;
  410.  
  411. FUNCTION Q3XDrawRegion_GetNextRegion(drawRegion: TQ3XDrawRegion; VAR nextDrawRegion: TQ3XDrawRegion): TQ3Status; C;
  412.  *  One of the next two functions must be called before using a draw region 
  413.  }
  414. {
  415.  *    Use this Start function if double buffering/image access services from the
  416.  *    Draw Context are not needed, you may still request clear for example
  417.  }
  418. FUNCTION Q3XDrawRegion_Start(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr): TQ3Status; C;
  419. {
  420.  *    Use this Start function if double buffering or image access services from 
  421.  *  the Draw Context are needed.
  422.  }
  423. FUNCTION Q3XDrawRegion_StartAccessToImageBuffer(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr; VAR image: UNIV Ptr): TQ3Status; C;
  424. {
  425.  *    This function is used to indicate that access to a DrawRegion is ended.
  426.  }
  427. FUNCTION Q3XDrawRegion_End(drawRegion: TQ3XDrawRegion): TQ3Status; C;
  428. FUNCTION Q3XDrawRegion_GetDeviceTransform(drawRegion: TQ3XDrawRegion; VAR deviceTransform: TQ3Matrix4x4Ptr): TQ3Status; C;
  429. FUNCTION Q3XDrawRegion_GetClipFlags(drawRegion: TQ3XDrawRegion; VAR clipMaskState: TQ3XClipMaskState): TQ3Status; C;
  430. FUNCTION Q3XDrawRegion_GetClipMask(drawRegion: TQ3XDrawRegion; VAR clipMask: TQ3BitmapPtr): TQ3Status; C;
  431. {$IFC TARGET_OS_MAC }
  432. FUNCTION Q3XDrawRegion_GetClipRegion(drawRegion: TQ3XDrawRegion; VAR rgnHandle: RgnHandle): TQ3Status; C;
  433. FUNCTION Q3XDrawRegion_GetGDHandle(drawRegion: TQ3XDrawRegion; VAR gdHandle: GDHandle): TQ3Status; C;
  434. {$ENDC}  {TARGET_OS_MAC}
  435.  
  436. FUNCTION Q3XDrawRegion_GetRendererPrivate(drawRegion: TQ3XDrawRegion; VAR rendererPrivate: UNIV Ptr): TQ3Status; C;
  437. FUNCTION Q3XDrawRegion_SetRendererPrivate(drawRegion: TQ3XDrawRegion; rendererPrivate: UNIV Ptr; deleteMethod: TQ3XDrawRegionRendererPrivateDeleteMethod): TQ3Status; C;
  438. FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; flag: TQ3Boolean): TQ3Status; C;
  439. FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; VAR useDefaultRenderingFlag: TQ3Boolean): TQ3Status; C;
  440.  
  441.  
  442. {*****************************************************************************
  443.  **                                                                             **
  444.  **                            Renderer Class Methods                             **
  445.  **                                                                             **
  446.  ****************************************************************************}
  447. {
  448.  *    Methods from Object
  449.  *        kQ3XMethodTypeObjectClassRegister
  450.  *        kQ3XMethodTypeObjectClassUnregister
  451.  *        kQ3XMethodTypeObjectNew
  452.  *        kQ3XMethodTypeObjectDelete
  453.  *        kQ3XMethodTypeObjectRead
  454.  *        kQ3XMethodTypeObjectTraverse
  455.  *        kQ3XMethodTypeObjectWrite
  456.  *        
  457.  *    Methods from Shared
  458.  *        kQ3MethodTypeSharedEdited
  459.  *
  460.  *    Renderer Methods
  461.  *    
  462.  *    The renderer methods should be implemented according to the type
  463.  *    of renderer being written.
  464.  *
  465.  *    For the purposes of documentation, there are two basic types of
  466.  *    renderers: 
  467.  *
  468.  *        Interactive
  469.  *            Interactive Renderer
  470.  *            WireFrame Renderer
  471.  *        
  472.  *        Deferred
  473.  *            a ray-tracer
  474.  *            painter's algorithm renderer (cached in a BSP triangle tree)
  475.  *            an artistic renderer (simulates a pencil drawing, etc.)
  476.  *
  477.  *    The main difference is how each renderer handles incoming state and 
  478.  *    geometry.
  479.  *
  480.  *    An interactive renderer immediately transforms, culls, and shades
  481.  *    incoming geometry and performs rasterization. For example, in a 
  482.  *    single-buffered WireFrame renderer, you will see a new triangle
  483.  *    immediately after Q3Triangle_Draw (if it's visible, of course).
  484.  *
  485.  *    A deferred renderer caches the view state and each geometry, 
  486.  *    converting into any internal queue of drawing commands. Rasterization
  487.  *    is not actually performed until all data has been submitted.
  488.  *    
  489.  *    For example, a ray-tracer may not rasterize anything until the
  490.  *    end of the rendering loop, or until an EndFrame call is made.
  491.  }
  492.  
  493. {*****************************************************************************
  494.  **                                                                             **
  495.  **                        Renderer User Interface Methods                         **
  496.  **                                                                             **
  497.  ****************************************************************************}
  498. {
  499.  *    kQ3XMethodTypeRendererIsInteractive
  500.  *    
  501.  *    There is no actual method with this - the metahandler simply returns
  502.  *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  503.  *  intended to be used in interactive settings, and   
  504.  *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  505.  *  
  506.  *  If neither value is specified in the metahandler, the renderer 
  507.  *  is *assumed to be non-interactive*!!!
  508.  *    
  509.  *    OPTIONAL
  510.  }
  511.  
  512. CONST
  513.     kQ3XMethodTypeRendererIsInteractive = 'isin';
  514.  
  515.  
  516. {
  517.  *    TQ3XRendererModalConfigureMethod
  518.  *    
  519.  *    This method should pop up a modal dialog to edit the renderer settings 
  520.  *    found in the renderer private. 
  521.  *    
  522.  *    dialogAnchor - is platform specific data passed by the client to support
  523.  *      movable modal dialogs. 
  524.  *    MacOS: this is a callback to the calling application's event handler.
  525.  *      The renderer calls this function with events not handled by the 
  526.  *      settings dialog. This is necessary in order to support movable modal 
  527.  *      dialogs. An application's event handler must return kQ3True if it 
  528.  *      handles the event passed to the callback or kQ3False if not. 
  529.  *      An application which doesn't want to support a movable modal configure
  530.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  531.  *      A renderer should implement a non-movable style dialog in that case.
  532.  *    Win32: this is the HWND of the owning window (typically an application's
  533.  *      main window).  (Win32 application modal dialogs are always movable.)
  534.  *  canceled - returns a boolean inditacating that the user canceled the 
  535.  *    dialog.
  536.  *    
  537.  *    OPTIONAL
  538.  }
  539.     kQ3XMethodTypeRendererModalConfigure = 'rdmc';
  540.  
  541.  
  542. TYPE
  543. {$IFC TYPED_FUNCTION_POINTERS}
  544.     TQ3XRendererModalConfigureMethod = FUNCTION(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean; rendererPrivate: UNIV Ptr): TQ3Status; C;
  545. {$ELSEC}
  546.     TQ3XRendererModalConfigureMethod = ProcPtr;
  547. {$ENDC}
  548.  
  549. {
  550.  *    kQ3XMethodTypeRendererGetNickNameString
  551.  *    
  552.  *        Allows an application to collect the name of the renderer for
  553.  *        display in a user interface item such as a menu.
  554.  *    
  555.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  556.  *        bytes of a data buffer large enough to store the renderer name. 
  557.  *
  558.  *      bufferSize is the actual size of the memory block pointed to by 
  559.  *        dataBuffer
  560.  *
  561.  *        actualDataSize - on return the actual number of bytes written to the
  562.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  563.  *
  564.  *    OPTIONAL
  565.  }
  566.  
  567. CONST
  568.     kQ3XMethodTypeRendererGetNickNameString = 'rdns';
  569.  
  570.  
  571. TYPE
  572. {$IFC TYPED_FUNCTION_POINTERS}
  573.     TQ3XRendererGetNickNameStringMethod = FUNCTION(VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  574. {$ELSEC}
  575.     TQ3XRendererGetNickNameStringMethod = ProcPtr;
  576. {$ENDC}
  577.  
  578. {
  579.  *    kQ3XMethodTypeRendererGetConfigurationData
  580.  *    
  581.  *        Allows an application to collect private configuration data from the
  582.  *      renderer which it will then save. For example in a preference file, 
  583.  *      a registry key (on Windows) or in a style template. An application 
  584.  *      should tag this data with the renderer's object name.
  585.  *    
  586.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  587.  *        bytes of a data buffer large enough to store private data. 
  588.  *
  589.  *      bufferSize is the actual size of the memory block pointed to by 
  590.  *        dataBuffer
  591.  *
  592.  *        actualDataSize - on return the actual number of bytes written to the
  593.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  594.  *
  595.  *    OPTIONAL
  596.  }
  597.  
  598. CONST
  599.     kQ3XMethodTypeRendererGetConfigurationData = 'rdgp';
  600.  
  601.  
  602. TYPE
  603. {$IFC TYPED_FUNCTION_POINTERS}
  604.     TQ3XRendererGetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  605. {$ELSEC}
  606.     TQ3XRendererGetConfigurationDataMethod = ProcPtr;
  607. {$ENDC}
  608.  
  609. {
  610.  *    TQ3XRendererSetConfigurationDataMethod
  611.  *    
  612.  *        Allows an application to pass private configuration data which has
  613.  *         previously  been obtained from a renderer via 
  614.  *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  615.  *        in a style template. An application should tag this data with the 
  616.  *        renderer's object name.
  617.  *    
  618.  *      bufferSize is the actual size of the memory block pointed to by 
  619.  *        dataBuffer
  620.  *
  621.  *    OPTIONAL
  622.  }
  623.  
  624. CONST
  625.     kQ3XMethodTypeRendererSetConfigurationData = 'rdsp';
  626.  
  627.  
  628. TYPE
  629. {$IFC TYPED_FUNCTION_POINTERS}
  630.     TQ3XRendererSetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  631. {$ELSEC}
  632.     TQ3XRendererSetConfigurationDataMethod = ProcPtr;
  633. {$ENDC}
  634.  
  635. {*****************************************************************************
  636.  **                                                                             **
  637.  **                        Renderer Drawing State Methods                         **
  638.  **                                                                             **
  639.  ****************************************************************************}
  640. {
  641.  *    TQ3RendererStartFrame
  642.  *    
  643.  *    The StartFrame method is called first at Q3View_StartRendering
  644.  *    and should:
  645.  *        - initialize any renderer state to defaults
  646.  *        - extract any and all useful data from the drawContext
  647.  *
  648.  *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  649.  *    registration, then it should also:
  650.  *        - clear the drawContext 
  651.  *    
  652.  *        When clearing, your renderer may opt to:
  653.  *        - NOT clear anything (if you touch every pixel, for example)
  654.  *        - to clear with your own routine, or
  655.  *        - to use the draw context default clear method by calling 
  656.  *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  657.  *        any available hardware in the system for clearing.
  658.  *    
  659.  *    This call also signals the start of all default submit commands from
  660.  *    the view. The renderer will receive updates for the default view
  661.  *    state via its Update methods before StartPass is called.
  662.  *    
  663.  *    REQUIRED
  664.  }
  665.  
  666. CONST
  667.     kQ3XMethodTypeRendererStartFrame = 'rdcl';
  668.  
  669.  
  670. TYPE
  671. {$IFC TYPED_FUNCTION_POINTERS}
  672.     TQ3XRendererStartFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  673. {$ELSEC}
  674.     TQ3XRendererStartFrameMethod = ProcPtr;
  675. {$ENDC}
  676.  
  677. {
  678.  *    kQ3XMethodTypeRendererStartPass
  679.  *    TQ3XRendererStartPassMethod
  680.  *    
  681.  *    The StartPass method is called during Q3View_StartRendering but after
  682.  *    the StartFrame command. It should:
  683.  *        - collect camera and light information
  684.  *    
  685.  *    If your renderer supports deferred camera transformation, camera is the
  686.  *    main camera which will be submitted in the hierarchy somewhere. It
  687.  *    is never NULL.
  688.  *
  689.  *    If your renderer does not support deferred camera transformation, camera
  690.  *    is the transformed camera.
  691.  *
  692.  *    If your renderer supports deferred light transformation, lights will be
  693.  *    NULL, and will be submitted to your light draw methods instead.
  694.  *
  695.  *    This call signals the end of the default update state, and the start of 
  696.  *  submit commands from the user to the view.
  697.  *
  698.  *    REQUIRED
  699.  }
  700.  
  701. CONST
  702.     kQ3XMethodTypeRendererStartPass = 'rdst';
  703.  
  704.  
  705. TYPE
  706. {$IFC TYPED_FUNCTION_POINTERS}
  707.     TQ3XRendererStartPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  708. {$ELSEC}
  709.     TQ3XRendererStartPassMethod = ProcPtr;
  710. {$ENDC}
  711.  
  712. {
  713.  *    kQ3XMethodTypeRendererFlushFrame
  714.  *    TQ3XRendererFlushFrameMethod
  715.  *    
  716.  *    This call is only implemented by asynchronous renderers.
  717.  *    
  718.  *    The FlushFrame method is called between the StartPass and EndPass
  719.  *    methods and is called when the user wishes to flush any asynchronous
  720.  *    drawing tasks (which draw to the drawcontext), but does not want 
  721.  *    to block.
  722.  *    
  723.  *    The result of this call is that an image should "eventually" appear
  724.  *    asynchronously.
  725.  *    
  726.  *    For asynchronous rendering, this call is non-blocking.
  727.  *    
  728.  *    An interactive renderer should ensure that all received
  729.  *    geometries are drawn in the image.
  730.  *    
  731.  *    An interactive renderer that talks to hardware should force
  732.  *    the hardware to generate an image.
  733.  *    
  734.  *    A deferred renderer should exhibit a similar behaviour,
  735.  *    though it is not required.  A deferred renderer should spawn
  736.  *    a process that generates a partial image from the currently
  737.  *    accumulated drawing state. 
  738.  *    
  739.  *    However, for renderers such as ray-tracers which generally are
  740.  *    quite compute-intensive, FlushFrame is not required and is a no-op.
  741.  *
  742.  *    OPTIONAL
  743.  }
  744.  
  745. CONST
  746.     kQ3XMethodTypeRendererFlushFrame = 'rdfl';
  747.  
  748.  
  749. TYPE
  750. {$IFC TYPED_FUNCTION_POINTERS}
  751.     TQ3XRendererFlushFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  752. {$ELSEC}
  753.     TQ3XRendererFlushFrameMethod = ProcPtr;
  754. {$ENDC}
  755.  
  756. {
  757.  *    kQ3XMethodTypeRendererEndPass
  758.  *    TQ3XRendererEndPassMethod
  759.  *    
  760.  *    The EndPass method is called at Q3View_EndRendering and signals
  761.  *    the end of submit commands to the view.
  762.  *
  763.  *    If an error occurs, the renderer should call Q3XError_Post and
  764.  *    return kQ3ViewStatusError.
  765.  *    
  766.  *    If a renderer requires another pass on the renderering data,
  767.  *    it should return kQ3ViewStatusRetraverse.
  768.  *    
  769.  *    If rendering was cancelled, this function will not be called
  770.  *    and the view will handle returning kQ3ViewStatusCancelled;
  771.  *    
  772.  *    Otherwise, your renderer should begin completing the process of 
  773.  *    generating the image in the drawcontext. If you have buffered
  774.  *    any drawing data, flush it. RendererEnd should have a similar
  775.  *    effect as RendererFlushFrame.
  776.  *    
  777.  *    If the renderer is synchronous:
  778.  *        - complete rendering of the entire frame
  779.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  780.  *            - Update the front buffer
  781.  *        else
  782.  *            - DrawContext will update the front buffer after returning
  783.  *
  784.  *    If the renderer is asynchronous
  785.  *        - spawn rendering thread for entire frame
  786.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  787.  *            - you must eventually update the front buffer asynchronously
  788.  *        else
  789.  *            - you must eventually update the back buffer asynchronously
  790.  *            
  791.  *    REQUIRED
  792.  }
  793.  
  794. CONST
  795.     kQ3XMethodTypeRendererEndPass = 'rded';
  796.  
  797.  
  798. TYPE
  799. {$IFC TYPED_FUNCTION_POINTERS}
  800.     TQ3XRendererEndPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3ViewStatus; C;
  801. {$ELSEC}
  802.     TQ3XRendererEndPassMethod = ProcPtr;
  803. {$ENDC}
  804.  
  805. {
  806.  *    kQ3XMethodTypeRendererEndFrame
  807.  *    TQ3XRendererEndFrame
  808.  *    
  809.  *    This call is only implemented by asynchronous renderers.
  810.  *
  811.  *    The EndFrame method is called from Q3View_Sync, which is
  812.  *    called after Q3View_EndRendering and signals that the user
  813.  *    wishes to see the completed image and is willing to block.
  814.  *    
  815.  *    If your renderer supports kQ3RendererFlagDoubleBuffer
  816.  *        - update the front buffer completely 
  817.  *    else
  818.  *        - update the back buffer completely
  819.  *
  820.  *    This call is equivalent in functionality to RendererFlushFrame
  821.  *    but blocks until the image is completed.
  822.  *    
  823.  *    If no method is supplied, the default is a no-op.
  824.  *    
  825.  *    NOTE: Registering a method of this type indicates that your renderer will
  826.  *    be rendering after Q3View_EndRendering has been called.
  827.  *    
  828.  *    OPTIONAL
  829.  }
  830.  
  831. CONST
  832.     kQ3XMethodTypeRendererEndFrame = 'rdsy';
  833.  
  834.  
  835. TYPE
  836. {$IFC TYPED_FUNCTION_POINTERS}
  837.     TQ3XRendererEndFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  838. {$ELSEC}
  839.     TQ3XRendererEndFrameMethod = ProcPtr;
  840. {$ENDC}
  841.  
  842. {
  843.  *    The RendererCancel method is called after Q3View_StartRendering
  844.  *    and signals the termination of all rendering operations.
  845.  *
  846.  *    A renderer should clean up any cached data, and cancel all 
  847.  *    rendering operations.
  848.  *    
  849.  *    If called before Q3View_EndRendering, the RendererEnd method
  850.  *    is NOT called.
  851.  *    
  852.  *    If called after Q3View_EndRendering, the renderer should kill
  853.  *    any threads and terminate any further rendering.
  854.  *    
  855.  *    REQUIRED
  856.  }
  857.  
  858. CONST
  859.     kQ3XMethodTypeRendererCancel = 'rdab';
  860.  
  861.  
  862. TYPE
  863. {$IFC TYPED_FUNCTION_POINTERS}
  864.     TQ3XRendererCancelMethod = PROCEDURE(view: TQ3ViewObject; rendererPrivate: UNIV Ptr); C;
  865. {$ELSEC}
  866.     TQ3XRendererCancelMethod = ProcPtr;
  867. {$ENDC}
  868.  
  869. {*****************************************************************************
  870.  **                                                                             **
  871.  **                        Renderer DrawContext Methods                         **
  872.  **                                                                             **
  873.  ****************************************************************************}
  874. {
  875.  *    kQ3XMethodTypeRendererPush
  876.  *    TQ3XRendererPushMethod
  877.  *    
  878.  *    kQ3XMethodTypeRendererPop
  879.  *    TQ3XRendererPopMethod
  880.  *    
  881.  *    These methods are called whenever the graphics state in the view
  882.  *    is pushed or popped. The user may isolate state by calling:
  883.  *    
  884.  *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  885.  *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  886.  *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  887.  *    Q3Box_Submit(&unitBox, view);
  888.  *    Q3TranslateTransform_Submit(&unitVector, view);
  889.  *    Q3Push_Submit(view);
  890.  *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  891.  *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  892.  *        Q3Box_Submit(&unitBox, view);
  893.  *    Q3Pop_Submit(view);    
  894.  *    Q3TranslateTransform_Submit(&unitVector, view);
  895.  *    Q3Box_Submit(&unitBox, view);
  896.  *    
  897.  *    or by submitting a display group which pushes and pops.
  898.  *    
  899.  *    If you support RendererPush and RendererPop in your renderer:
  900.  *        - you must maintain your drawing state as a stack, as well.
  901.  *        - you will not be updated with the popped state after
  902.  *            RendererPop is called.
  903.  *
  904.  *    If you do not support Push and Pop in your renderer:
  905.  *        - you may maintain a single copy of the drawing state.
  906.  *        - you will be updated with changed fields after the view stack is
  907.  *            popped.
  908.  *
  909.  *    A renderer that supports Push and Pop gets called in the following
  910.  *    sequence (from example above):
  911.  *    
  912.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  913.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  914.  *    RendererUpdateAttributeSpecularColor(&white,...)
  915.  *    RendererUpdateMatrixLocalToWorld(...)
  916.  *    RendererSubmitGeometryBox(...)
  917.  *    RendererPush(...)
  918.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  919.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  920.  *        RendererSubmitGeometryBox(...)
  921.  *    RendererPop(...)
  922.  *    RendererUpdateMatrixLocalToWorld(...)
  923.  *    RendererSubmitGeometryBox(...)
  924.  *
  925.  *    A renderer that does not supports Push and Pop gets called in the
  926.  *    following sequence:
  927.  *    
  928.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  929.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  930.  *    RendererUpdateAttributeSpecularColor(&white,...)
  931.  *    RendererUpdateMatrixLocalToWorld(...)
  932.  *    RendererSubmitGeometryBox(...)
  933.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  934.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  935.  *        RendererSubmitGeometryBox(...)
  936.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  937.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  938.  *    RendererUpdateMatrixLocalToWorld(...)
  939.  *    RendererSubmitGeometryBox(...)
  940.  *    
  941.  }
  942.  
  943. CONST
  944.     kQ3XMethodTypeRendererPush    = 'rdps';
  945.  
  946.  
  947. TYPE
  948. {$IFC TYPED_FUNCTION_POINTERS}
  949.     TQ3XRendererPushMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  950. {$ELSEC}
  951.     TQ3XRendererPushMethod = ProcPtr;
  952. {$ENDC}
  953.  
  954.  
  955. CONST
  956.     kQ3XMethodTypeRendererPop    = 'rdpo';
  957.  
  958.  
  959. TYPE
  960. {$IFC TYPED_FUNCTION_POINTERS}
  961.     TQ3XRendererPopMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  962. {$ELSEC}
  963.     TQ3XRendererPopMethod = ProcPtr;
  964. {$ENDC}
  965.  
  966. {*****************************************************************************
  967.  **                                                                             **
  968.  **                            Renderer Cull Methods                             **
  969.  **                                                                             **
  970.  ****************************************************************************}
  971. {
  972.  *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  973.  *    TQ3XRendererIsBoundingBoxVisibleMethod
  974.  *    
  975.  *    This method is called to cull complex groups and geometries 
  976.  *    given their bounding box in local space.
  977.  *    
  978.  *    It should transform the local-space bounding box coordinates to
  979.  *    frustum space and return a TQ3Boolean return value indicating
  980.  *    whether the box appears within the viewing frustum.
  981.  *    
  982.  *    If no method is supplied, the default behavior is to return
  983.  *    kQ3True.
  984.  *    
  985.  }
  986.  
  987. CONST
  988.     kQ3XMethodTypeRendererIsBoundingBoxVisible = 'rdbx';
  989.  
  990.  
  991. TYPE
  992. {$IFC TYPED_FUNCTION_POINTERS}
  993.     TQ3XRendererIsBoundingBoxVisibleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; (CONST)VAR bBox: TQ3BoundingBox): TQ3Boolean; C;
  994. {$ELSEC}
  995.     TQ3XRendererIsBoundingBoxVisibleMethod = ProcPtr;
  996. {$ENDC}
  997.  
  998.  
  999. {*****************************************************************************
  1000.  **                                                                             **
  1001.  **                        Renderer Object Support Methods                         **
  1002.  **                                                                             **
  1003.  ****************************************************************************}
  1004. {
  1005.  *    Drawing methods (Geometry, Camera, Lights)
  1006.  *
  1007.  }
  1008. {
  1009.  *    Geometry MetaHandler
  1010.  *    
  1011.  *    This metaHandler is required to support 
  1012.  *    
  1013.  *    kQ3GeometryTypeTriangle
  1014.  *    kQ3GeometryTypeLine
  1015.  *    kQ3GeometryTypePoint
  1016.  *    kQ3GeometryTypeMarker
  1017.  *    kQ3GeometryTypePixmapMarker
  1018.  *    
  1019.  *    REQUIRED
  1020.  }
  1021.  
  1022. CONST
  1023.     kQ3XMethodTypeRendererSubmitGeometryMetaHandler = 'rdgm';
  1024.  
  1025.  
  1026. TYPE
  1027. {$IFC TYPED_FUNCTION_POINTERS}
  1028.     TQ3XRendererSubmitGeometryMetaHandlerMethod = FUNCTION(geometryType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1029. {$ELSEC}
  1030.     TQ3XRendererSubmitGeometryMetaHandlerMethod = ProcPtr;
  1031. {$ENDC}
  1032.  
  1033. {
  1034.  *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1035.  *    of kQ3GeometryTypeFoo and returns methods of type:
  1036.  }
  1037. {$IFC TYPED_FUNCTION_POINTERS}
  1038.     TQ3XRendererSubmitGeometryMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; geometry: TQ3GeometryObject; publicData: UNIV Ptr): TQ3Status; C;
  1039. {$ELSEC}
  1040.     TQ3XRendererSubmitGeometryMethod = ProcPtr;
  1041. {$ENDC}
  1042.  
  1043. {
  1044.  *    Camera MetaHandler
  1045.  *    
  1046.  *    This metaHandler, if supplied, indicates that your renderer
  1047.  *    handles deferred transformation of the main camera within a scene.
  1048.  *    
  1049.  *    If not supplied, or an unsupported camera is used, the view will do
  1050.  *    the transformation for the renderer and pass in a camera in the 
  1051.  *    StartPass method.
  1052.  *    
  1053.  *    OPTIONAL
  1054.  }
  1055.  
  1056. CONST
  1057.     kQ3XMethodTypeRendererSubmitCameraMetaHandler = 'rdcm';
  1058.  
  1059.  
  1060. TYPE
  1061. {$IFC TYPED_FUNCTION_POINTERS}
  1062.     TQ3XRendererSubmitCameraMetaHandlerMethod = FUNCTION(cameraType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1063. {$ELSEC}
  1064.     TQ3XRendererSubmitCameraMetaHandlerMethod = ProcPtr;
  1065. {$ENDC}
  1066.  
  1067. {
  1068.  *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1069.  *    of kQ3CameraTypeFoo and returns methods of type:
  1070.  }
  1071. {$IFC TYPED_FUNCTION_POINTERS}
  1072.     TQ3XRendererSubmitCameraMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; publicData: UNIV Ptr): TQ3Status; C;
  1073. {$ELSEC}
  1074.     TQ3XRendererSubmitCameraMethod = ProcPtr;
  1075. {$ENDC}
  1076.  
  1077. {
  1078.  *    Light MetaHandler
  1079.  *    
  1080.  *    This metaHandler, if supplied, indicates that your renderer
  1081.  *    handles deferred transformation of lights within a scene.
  1082.  *    
  1083.  *    If an unsupported light is encountered, it is ignored.
  1084.  *
  1085.  *    OPTIONAL
  1086.  }
  1087.  
  1088. CONST
  1089.     kQ3XMethodTypeRendererSubmitLightMetaHandler = 'rdlg';
  1090.  
  1091.  
  1092. TYPE
  1093. {$IFC TYPED_FUNCTION_POINTERS}
  1094.     TQ3XRendererSubmitLightMetaHandlerMethod = FUNCTION(lightType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1095. {$ELSEC}
  1096.     TQ3XRendererSubmitLightMetaHandlerMethod = ProcPtr;
  1097. {$ENDC}
  1098.  
  1099. {
  1100.  *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1101.  *    of kQ3LightTypeFoo and returns methods of type:
  1102.  }
  1103. {$IFC TYPED_FUNCTION_POINTERS}
  1104.     TQ3XRendererSubmitLightMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; light: TQ3LightObject; publicData: UNIV Ptr): TQ3Status; C;
  1105. {$ELSEC}
  1106.     TQ3XRendererSubmitLightMethod = ProcPtr;
  1107. {$ENDC}
  1108.  
  1109. {
  1110.  *
  1111.  *    Update methods
  1112.  *
  1113.  *    They are called whenever the state has changed. If the renderer supports
  1114.  *    the RendererPush and RendererPop methods, it must maintain its own state
  1115.  *    stack. Updates are not called for changed data when the view stack is
  1116.  *    popped.
  1117.  *
  1118.  *    See the comments for the RendererPush and RendererPop methods above
  1119.  *    for an example of how data is updated.
  1120.  *
  1121.  }
  1122. {
  1123.  *    Style
  1124.  }
  1125.  
  1126. CONST
  1127.     kQ3XMethodTypeRendererUpdateStyleMetaHandler = 'rdyu';
  1128.  
  1129.  
  1130. TYPE
  1131. {$IFC TYPED_FUNCTION_POINTERS}
  1132.     TQ3XRendererUpdateStyleMetaHandlerMethod = FUNCTION(styleType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1133. {$ELSEC}
  1134.     TQ3XRendererUpdateStyleMetaHandlerMethod = ProcPtr;
  1135. {$ENDC}
  1136.  
  1137. {
  1138.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1139.  *    of kQ3StyleTypeFoo and returns methods of type:
  1140.  }
  1141. {$IFC TYPED_FUNCTION_POINTERS}
  1142.     TQ3XRendererUpdateStyleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1143. {$ELSEC}
  1144.     TQ3XRendererUpdateStyleMethod = ProcPtr;
  1145. {$ENDC}
  1146.  
  1147. {
  1148.  *    Attributes
  1149.  }
  1150.  
  1151. CONST
  1152.     kQ3XMethodTypeRendererUpdateAttributeMetaHandler = 'rdau';
  1153.  
  1154.  
  1155. TYPE
  1156. {$IFC TYPED_FUNCTION_POINTERS}
  1157.     TQ3XRendererUpdateAttributeMetaHandlerMethod = FUNCTION(attributeType: TQ3AttributeType): TQ3XFunctionPointer; C;
  1158. {$ELSEC}
  1159.     TQ3XRendererUpdateAttributeMetaHandlerMethod = ProcPtr;
  1160. {$ENDC}
  1161.  
  1162. {
  1163.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1164.  *    of kQ3AttributeTypeFoo and returns methods of type:
  1165.  }
  1166. {$IFC TYPED_FUNCTION_POINTERS}
  1167.     TQ3XRendererUpdateAttributeMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1168. {$ELSEC}
  1169.     TQ3XRendererUpdateAttributeMethod = ProcPtr;
  1170. {$ENDC}
  1171.  
  1172. {
  1173.  *    Shaders
  1174.  }
  1175.  
  1176. CONST
  1177.     kQ3XMethodTypeRendererUpdateShaderMetaHandler = 'rdsu';
  1178.  
  1179.  
  1180. TYPE
  1181. {$IFC TYPED_FUNCTION_POINTERS}
  1182.     TQ3XRendererUpdateShaderMetaHandlerMethod = FUNCTION(shaderType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1183. {$ELSEC}
  1184.     TQ3XRendererUpdateShaderMetaHandlerMethod = ProcPtr;
  1185. {$ENDC}
  1186.  
  1187. {
  1188.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1189.  *    of kQ3ShaderTypeFoo and returns methods of type:
  1190.  }
  1191. {$IFC TYPED_FUNCTION_POINTERS}
  1192.     TQ3XRendererUpdateShaderMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; VAR shaderObject: TQ3Object): TQ3Status; C;
  1193. {$ELSEC}
  1194.     TQ3XRendererUpdateShaderMethod = ProcPtr;
  1195. {$ENDC}
  1196.  
  1197. {
  1198.  *    Matrices
  1199.  }
  1200.  
  1201. CONST
  1202.     kQ3XMethodTypeRendererUpdateMatrixMetaHandler = 'rdxu';
  1203.  
  1204.  
  1205. TYPE
  1206.     TQ3XRendererUpdateMatrixMetaHandlerMethod = TQ3XMetaHandler;
  1207. {
  1208.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1209.  *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1210.  }
  1211.  
  1212. CONST
  1213.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorld = 'ulwx';
  1214.  
  1215.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse = 'ulwi';
  1216.  
  1217.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose = 'ulwt';
  1218.  
  1219.     kQ3XMethodTypeRendererUpdateMatrixLocalToCamera = 'ulcx';
  1220.  
  1221.     kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum = 'ulfx';
  1222.  
  1223.     kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum = 'uwfx';
  1224.  
  1225. {
  1226.  *    and returns methods of type:
  1227.  }
  1228.  
  1229. TYPE
  1230. {$IFC TYPED_FUNCTION_POINTERS}
  1231.     TQ3XRendererUpdateMatrixMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; (CONST)VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  1232. {$ELSEC}
  1233.     TQ3XRendererUpdateMatrixMethod = ProcPtr;
  1234. {$ENDC}
  1235.  
  1236.  
  1237. {$ALIGN RESET}
  1238. {$POP}
  1239.  
  1240. {$SETC UsingIncludes := QD3DRendererIncludes}
  1241.  
  1242. {$ENDC} {__QD3DRENDERER__}
  1243.  
  1244. {$IFC NOT UsingIncludes}
  1245.  END.
  1246. {$ENDC}
  1247.